<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script language="javascript">
function inn(){window.print();}
</script>
<table width="990px" id="er" style="margin-top:6px">
	<tr>
		<td align="right" >
			<span class="span__16">Chi tiết hóa đơn</span>
			<a href="?thamso=quan_ly_hoa_don&trang=<?php echo $_GET['trang']; ?>" class="nut_dong" style="color:red">
				Đóng
			</a>
		</td>
	</tr>	
			</table>
			
				<table  border="1" style="margin:6px" id="er_2">
					<tr>
						<td width="50px" align="center"><b>Stt</b></td>
						<td width="300px"><b>Tên</b></td>
						<td width="150px"><b>Giá bán (VNĐ)</b></td>	
						<td width="100px"><b>Số lượng</b></td>
					</tr>
					<?php
					
				$tv="select hoa_don.ho_ten, hoa_don.dia_chi, hoa_don.hom_thu, hoa_don.dien_thoai, hoa_don.noi_dung,
				 dm_sanpham.tensp, dm_sanpham.gia, cthd.soluong from cthd, hoa_don,dm_sanpham where  
				hoa_don.idHD=cthd.idHD and cthd.idsp=dm_sanpham.idsp and hoa_don.idHD='$_GET[id]'";
				
				$tv_1=mysql_query($tv);
				$i=0;
					while($tv_2=mysql_fetch_array($tv_1))
					{
						?>
								<tr>
									<td ><?php echo $i++; ?></td>
									<td ><?php echo $tv_2['tensp']; ?></td>
									<td ><?php echo $tv_2['gia']; ?></td>	
									<td ><?php echo $tv_2['soluong']; ?></td>
								</tr>
						<?php
					}
					?>
				</table>
				<br>
				<?php
				$query="select hoa_don.idHD, hoa_don.ho_ten, hoa_don.dia_chi, hoa_don.hom_thu, hoa_don.dien_thoai, hoa_don.noi_dung 
				from hoa_don where hoa_don.idHD='$_GET[id]' ";
				$result=mysql_query($query);
				$row=mysql_fetch_array($result);
				?>
				<table border="1" >
					<tr>
						<td ><b>Họ tên :</b></td>
						<td><?php echo $row['ho_ten'];?></td>
					</tr>
					<tr>
						<td ><b>Địa chỉ :</b></td>
			
						<td><?php echo $row['dia_chi'];?></td>
					</tr>
					<tr>
						<td><b>Email :</b></td>
						<td><?php echo $row['hom_thu'];?></td>
					</tr>
					<tr>
			
						<td><b>Điện thoại : </b></td>
						<td><?php echo $row['dien_thoai'];?></td>
					</tr>
					<tr>
						<td valign="top"><b>Nội dung :</b></td>
						<td>
							<?php echo $row['noi_dung'];?>
						</td>
					</tr>
					<tr>
						<td valign="top">&nbsp;</td>
						<td>
							<?php 
								if ($_GET['hd_tam']='yes') {
									$link_xoa_hoa_don="?thamso=xoa_hd&id=$row[idHD]&hd_tam=yes";
								}
								else
									$link_xoa_hoa_don = "?thamso=xoa_hd&id=$row[idHD]";
							 ?>
							<a href="<?php echo $link_xoa_hoa_don; ?>" class="sua_xoa" style="color:red">Xóa</a>
						</td>
					</tr>
				</table>
<script>
	table_css_1("er");
	table_css_2("er_2");
	table_css_2("er_3");
</script>

